/**
 * 	write on 2005-10-26 10:53:38.
 */
package org.nanhill.xmlro;

import java.util.Date;

/**
 * 
 * Object --> xml Builder and Director
 * 
 * @author alin
 * 
 */
public interface XmlroOutput {
	void setSerializerFactory(SerializerFactory serializerFactory);

	StringBuilder getProduct();

	void setParsed(Object obj);

	void writeHeader();

	void writeFooter();

	/**
	 * Writes a boolean value to the stream.
	 * 
	 * @param value
	 *            the boolean value to write.
	 */
	void writeBoolean(boolean value);

	/**
	 * Writes an integer value to the stream.
	 * 
	 * @param value
	 *            the integer value to write.
	 */
	void writeInt(int value);

	void writeShort(short value);

	/**
	 * Writes a long value to the stream.
	 * 
	 * 
	 * @param value
	 *            the long value to write.
	 */
	void writeLong(long value);

	/**
	 * Writes a double value to the stream.
	 * 
	 * @param value
	 *            the double value to write.
	 */
	void writeDouble(double value);

	/**
	 * Writes a null value to the stream.
	 * 
	 * @param value
	 *            the string value to write.
	 */
	void writeNull();

	/**
	 * Writes a string value to the stream .
	 * 
	 * @param v
	 *            the string value to write.
	 */
	void writeString(String v);

	void writeChar(char value);

	void writeByte(byte value);

	/**
	 * Writes a byte array to the stream.
	 * 
	 * @param value
	 *            the string value to write.
	 */
	void writeBytes(byte[] v);

	void writeDate(Date date);

	/**
	 * Writes a generic object to the output stream.
	 */
	void writeObject(Object obj) throws XmlroException;

	/**
	 * Writes the list header to the stream. List writers will call
	 * <code>writeListBegin</code> followed by the list contents and then call
	 * <code>writeListEnd</code>.
	 * 
	 */
	void writeListBegin();

	/**
	 * Writes the list size.
	 * 
	 * @param size
	 */
	void writeListSize(int size);

	void writeListElementSplit();

	/**
	 * Writes the tail of the list to the stream.
	 */
	void writeListEnd();

	/**
	 * Writes the map header to the stream. Map writers will call
	 * <code>writeMapBegin</code> followed by the map contents and then call
	 * <code>writeMapEnd</code>.
	 * 
	 */
	void writeMapBegin();

	/**
	 * Writes the tail of the map to the stream.
	 */
	void writeMapEnd();

	void writeMapElementSplit();

	void writeMapKey(String key);

	// void writeMapMemberBegin(String key);

	// void writeMapMemberEnd();

	/**
	 * @param f
	 */
	void writeFloat(float v);

	void construct() throws XmlroException;

}
